package com.vrv.im.service.impl;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.vrv.im.domain.AnnexBean;
import com.vrv.im.persistence.AnnexMapper;
import com.vrv.im.service.AnnexService;

@Service
public class AnnexServiceImpl implements AnnexService{

	@Autowired
	private AnnexMapper mapper;
	public List<String> getFileByListID(List<Long> fileListID) {
		// TODO Auto-generated method stub
		Map<String,List<Long>> map=new HashMap<String,List<Long>>();
		map.put("list", fileListID);
		return mapper.getAnnex(map);
	}
	@Override
	public List<Long> addAnnex(List<String> fileUrls) {
		List<Long> fileIDs=new ArrayList<Long>();
		if(fileUrls!=null&&fileUrls.size()>0){
			for(String url:fileUrls){
				AnnexBean b=new AnnexBean();
				b.setFileUrl(url);
				mapper.addAnnex(b);
				fileIDs.add(b.getFileID());
			}
		}
		return fileIDs;
	}

}
